<?php
return array(

	'attributeLabels' => array(
		'shop_id' => '所属店铺',
		'worker_id' => '供应商'
	),

	'cascade' => array(
		'profile',
	),

	'rules' => array(
		array('worker_id', 'required'),
	),
	
	'relations' => array(
		'profile' => array(ActiveRecord::HAS_ONE, 'ShopMessageProfile', 'id'),
		'shop' => array(CActiveRecord::BELONGS_TO, 'Shop', 'shop_id'),
	),

	'behaviors' => array(
		'userScope' => array(
			'class' => 'coms.behaviors.userScopes.DefaultScope',
			'relatedFields' => array(
				'worker_id',
			),
			'autoRun' => false,
		),
		'uidResolver' => array(
			'class' => 'coms.behaviors.AutoIdResolve',
		),
		'shopidResolver' => array(
			'class' => 'coms.behaviors.shop.AutoShopIdResolve',
		),
		'fornt' => array(
			'class' => 'coms.behaviors.FrontBehavior',
			'attributes' => array(
				'title' => 'title'
			),
			'route' => 'shop/message'
		),
	),
	'tableName' => 'shop_message',

	'_import' => array(
		array('*', 'models.ContentBase//*'),
	),
);